<?php
class Listing_Form_AddNewComplainForm extends Ac_Form
{
	public function newComment()
	{
		$form = $this->getNewSubForm();
		$form->addElement('text', 'n', array(
            'id'         => 'add_complain',
            'name'       => 'n',
            'validators' => array(
                array('NotEmpty', true, array('messages' => '此信息是必需填写')),
            ),
            'decorators' => array(
                            'ViewHelper',
                            'Errors',                            
                            array('Label', array('placement' => 'prepend')),
                            array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'add_comments text', 'style'=>'padding-left:77px')),
            ),
            'required'   => true,
        ));
        $this->addSubForm($form, 'addcomplain');
	}
		
	public function init()
	{
		parent::init();
		$view = Zend_Registry::get('Zend_View');
		$this->setAction($view->url());
		$this->newComment();
	}
	
	private function getNewSubForm()
    {
        $form = new Ac_SubForm();
        return $form;
    }
}